package com.tongji.admin.command
{
	import com.tongji.admin.event.TypeAdminEvent;
	import com.tongji.admin.model.DictModel;
	import com.tongji.admin.service.HouseDiyAdminService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author yanghanbing
	 * 2011/7/
	 */ 
	public class TypeAdminCommand extends Command
	{
		[Inject]
		public var event:TypeAdminEvent;
		
		[Inject]
		public var service:HouseDiyAdminService;
		
		[Inject]
		public var model:DictModel;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case "addType":
					service.addAType(event.newtype);
					break;
				case "getAllType":
					service.getAllType();
					break;
				case "updateTypeArray":
					model.updateTypeArray(event.typeArray);
					break;
			}
		}
	}
}